package com.company.admin.controller.user;

import com.company.admin.common.result.ResultResponse;
import com.company.admin.req.user.UserLoginRequest;
import com.company.admin.resp.user.UserLoginResponse;
import com.company.admin.service.user.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import sun.security.provider.certpath.PKIXTimestampParameters;

/**
 * @author 赵成林
 * @date 2019/2/16 21:57
 */
@RequestMapping(value = "/admin/user")
@Controller
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping(value = "/login",method = RequestMethod.POST)
    @ResponseBody
    public ResultResponse<UserLoginResponse> login(@RequestBody UserLoginRequest userLoginRequest){
        UserLoginResponse response = userService.login(userLoginRequest);
        return ResultResponse.onSuccess(response,null);
    }
}
